package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StoreRawMaterialManagementMapper;
import com.ruoyi.system.domain.StoreRawMaterialManagement;
import com.ruoyi.system.service.IStoreRawMaterialManagementService;

/**
 * 门店原料管理信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-27
 */
@Service
public class StoreRawMaterialManagementServiceImpl implements IStoreRawMaterialManagementService
{
    @Autowired
    private StoreRawMaterialManagementMapper storeRawMaterialManagementMapper;

    /**
     * 通过id查询门店原料管理信息
     *
     * @param id 门店原料管理信息主键
     * @return 门店原料管理信息
     */
    @Override
    public StoreRawMaterialManagement selectStoreRawMaterialManagementById(Long id)
    {
        return storeRawMaterialManagementMapper.selectStoreRawMaterialManagementById(id);
    }

    /**
     * 通过条件查询门店原料管理信息列表
     *
     * @param materialName,barcode 原料名称，原料条码
     * @return 门店原料管理信息
     */
    @Override
    public List<StoreRawMaterialManagement> selectStoreRawMaterialManagementListByConditions(String materialName, String barcode)
    {
        return storeRawMaterialManagementMapper.selectStoreRawMaterialManagementListByConditions(materialName,barcode);
    }

    /**
     * 新增门店原料管理信息
     *
     * @param storeRawMaterialManagement 门店原料管理信息
     * @return 结果
     */
    @Override
    public int insertStoreRawMaterialManagement(StoreRawMaterialManagement storeRawMaterialManagement)
    {
        return storeRawMaterialManagementMapper.insertStoreRawMaterialManagement(storeRawMaterialManagement);
    }

    /**
     * 修改门店原料管理信息
     *
     * @param storeRawMaterialManagement 门店原料管理信息
     * @return 结果
     */
    @Override
    public int updateStoreRawMaterialManagement(StoreRawMaterialManagement storeRawMaterialManagement)
    {
        return storeRawMaterialManagementMapper.updateStoreRawMaterialManagement(storeRawMaterialManagement);
    }

    /**
     * 通过id批量删除门店原料管理信息
     *
     * @param ids 需要删除的门店原料管理信息主键
     * @return 结果
     */
    @Override
    public int deleteStoreRawMaterialManagementByIds(Long[] ids)
    {
        return storeRawMaterialManagementMapper.deleteStoreRawMaterialManagementByIds(ids);
    }

    /**
     * 通过id删除门店原料管理信息
     *
     * @param id 门店原料管理信息主键
     * @return 结果
     */
    @Override
    public int deleteStoreRawMaterialManagementById(Long id)
    {
        return storeRawMaterialManagementMapper.deleteStoreRawMaterialManagementById(id);
    }
}
